const DURATION = 2000

export function useSuccessMessage(message: string | undefined, duration = DURATION) {
	return ElMessage({
		type: 'success',
		message,
		duration,
	})
}

export function useErrorMessage(message: string | undefined, duration = DURATION) {
	return ElMessage({
		type: 'error',
		message,
		duration,
		grouping: true,
	})
}

export function useWarningMessage(message: string | undefined, duration = DURATION) {
	return ElMessage({
		type: 'warning',
		message,
		duration,
	})
}
